/*
 * @Author: fah 1742484532@qq.com
 * @Date: 2024-09-12 11:37:16
 * @LastEditors: fah 1742484532@qq.com
 * @LastEditTime: 2024-09-14 16:09:40
 * @FilePath: \livetree-admin-server\src\lives\lives.controller.ts
 * @Description: 指飞部-企业数字化管理系统
 * @version: 1.0
 */
import {
  Controller,
  Get,
  Post,
  Body,
  Patch,
  Param,
  Delete,
  UseGuards,
} from '@nestjs/common';
import { LivesService } from './lives.service';
import { CreateLifeDto } from './dto/create-live.dto';
import { UpdateLifeDto } from './dto/update-live.dto';
import { QueryLifeDto } from './dto/query-live.dto';
import { AuthGuard } from 'src/auth/auth.guard';

@Controller('live')
export class LivesController {
  constructor(private readonly livesService: LivesService) {}

  @Post('/createLive')
  create(@Body() createLifeDto: CreateLifeDto) {
    return this.livesService.create(createLifeDto);
  }

  @UseGuards(AuthGuard)
  @Post('/getLiveList')
  findAll(@Body() QueryLifeDto: QueryLifeDto) {
    return this.livesService.getLiveList(QueryLifeDto);
  }

  @Get(':id')
  findOne(@Param('id') id: string) {
    return this.livesService.findOne(+id);
  }

  @Patch(':id')
  update(@Param('id') id: string, @Body() updateLifeDto: UpdateLifeDto) {
    return this.livesService.update(+id, updateLifeDto);
  }

  @Delete(':id')
  remove(@Param('id') id: string) {
    return this.livesService.remove(+id);
  }
}
